home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tk / checkbutton.z / checkbutton
Encoding:
Text File  |  1998-10-30  |  19.1 KB  |  331 lines

  1.  
  2.  
  3.  
  4. cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      checkbutton - Create and manipulate checkbutton widgets
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  13.  
  14. SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  15.      aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  ccccuuuurrrrssssoooorrrr              hhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssss ttttaaaakkkkeeeeFFFFooooccccuuuussss       |
  16.      aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd  ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd  iiiimmmmaaaaggggeeee              tttteeeexxxxtttt            |
  17.      aaaannnncccchhhhoooorrrr            ffffoooonnnntttt                jjjjuuuussssttttiiiiffffyyyy            tttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee    |
  18.      bbbbaaaacccckkkkggggrrrroooouuuunnnndddd        ffffoooorrrreeeeggggrrrroooouuuunnnndddd          ppppaaaaddddXXXX               uuuunnnnddddeeeerrrrlllliiiinnnneeee       |
  19.      bbbbiiiittttmmmmaaaapppp            hhhhiiiigggghhhhlllliiiigggghhhhttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd ppppaaaaddddYYYY               wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh      |
  20.      bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh       hhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr      rrrreeeelllliiiieeeeffff
  21.  
  22.      See the ``options'' manual entry for details on the standard options.
  23.  
  24. WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  25.      Name:           ccccoooommmmmmmmaaaannnndddd
  26.      Class:          CCCCoooommmmmmmmaaaannnndddd
  27.      Command-Line Switch:----ccccoooommmmmmmmaaaannnndddd
  28.  
  29.           Specifies a Tcl command to associate with the button.  This command
  30.           is typically invoked when mouse button 1 is released over the button
  31.           window.  The button's global variable (----vvvvaaaarrrriiiiaaaabbbblllleeee option) will be
  32.           updated before the command is invoked.
  33.  
  34.      Name:           hhhheeeeiiiigggghhhhtttt
  35.      Class:          HHHHeeeeiiiigggghhhhtttt
  36.      Command-Line Switch:----hhhheeeeiiiigggghhhhtttt
  37.  
  38.           Specifies a desired height for the button.  If an image or bitmap is
  39.           being displayed in the button then the value is in screen units
  40.           (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is
  41.           in lines of text.  If this option isn't specified, the button's
  42.           desired height is computed from the size of the image or bitmap or
  43.           text being displayed in it.
  44.  
  45.      Name:           iiiinnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn                                              |
  46.      Class:          IIIInnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn                                              |
  47.      Command-Line Switch:----iiiinnnnddddiiiiccccaaaattttoooorrrroooonnnn                                         |
  48.  
  49.           Specifies whether or not the indicator should be drawn.  Must be a  |
  50.           proper boolean value.  If false, the rrrreeeelllliiiieeeeffff option is ignored and   |
  51.           the widget's relief is always sunken if the widget is selected and  |
  52.           raised otherwise.
  53.  
  54.      Name:           ooooffffffffVVVVaaaalllluuuueeee
  55.      Class:          VVVVaaaalllluuuueeee
  56.      Command-Line Switch:----ooooffffffffvvvvaaaalllluuuueeee
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.           Specifies value to store in the button's associated variable
  75.           whenever this button is deselected.  Defaults to ``0''.
  76.  
  77.      Name:           oooonnnnVVVVaaaalllluuuueeee
  78.      Class:          VVVVaaaalllluuuueeee
  79.      Command-Line Switch:----oooonnnnvvvvaaaalllluuuueeee
  80.  
  81.           Specifies value to store in the button's associated variable
  82.           whenever this button is selected.  Defaults to ``1''.
  83.  
  84.      Name:           sssseeeelllleeeeccccttttCCCCoooolllloooorrrr                                              |
  85.      Class:          BBBBaaaacccckkkkggggrrrroooouuuunnnndddd                                               |
  86.      Command-Line Switch:----sssseeeelllleeeeccccttttccccoooolllloooorrrr                                         |
  87.  
  88.           Specifies a background color to use when the button is selected.  If|
  89.           iiiinnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn is true then the color applicies to the indicator.  If  |
  90.           iiiinnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn is false, this color is used as the background for the  |
  91.           entire widget, in place of bbbbaaaacccckkkkggggrrrroooouuuunnnndddd or aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd, whenever |
  92.           the widget is selected.  If specified as an empty string then no    |
  93.           special color is used for displaying when the widget is selected.
  94.  
  95.      Name:           sssseeeelllleeeeccccttttIIIImmmmaaaaggggeeee                                              |
  96.      Class:          SSSSeeeelllleeeeccccttttIIIImmmmaaaaggggeeee                                              |
  97.      Command-Line Switch:----sssseeeelllleeeeccccttttiiiimmmmaaaaggggeeee                                         |
  98.  
  99.           Specifies an image to display (in place of the iiiimmmmaaaaggggeeee option) when   |
  100.           the checkbutton is selected.  This option is ignored unless the     |
  101.           iiiimmmmaaaaggggeeee option has been specified.
  102.  
  103.      Name:           ssssttttaaaatttteeee
  104.      Class:          SSSSttttaaaatttteeee
  105.      Command-Line Switch:----ssssttttaaaatttteeee
  106.  
  107.           Specifies one of three states for the checkbutton:  nnnnoooorrrrmmmmaaaallll, aaaaccccttttiiiivvvveeee,
  108.           or ddddiiiissssaaaabbbblllleeeedddd.  In normal state the checkbutton is displayed using the
  109.           ffffoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options.  The active state is typically
  110.           used when the pointer is over the checkbutton.  In active state the
  111.           checkbutton is displayed using the aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and
  112.           aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd options.  Disabled state means that the checkbutton|
  113.           should be insensitive:  the default bindings will refuse to activate|
  114.           the widget and will ignore mouse button presses.  In this state the
  115.           ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options determine how the
  116.           checkbutton is displayed.
  117.  
  118.      Name:           vvvvaaaarrrriiiiaaaabbbblllleeee
  119.      Class:          VVVVaaaarrrriiiiaaaabbbblllleeee
  120.      Command-Line Switch:----vvvvaaaarrrriiiiaaaabbbblllleeee
  121.  
  122.           Specifies name of global variable to set to indicate whether or not
  123.           this button is selected.  Defaults to the name of the button within
  124.           its parent (i.e. the last element of the button window's path name).
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      Name:           wwwwiiiiddddtttthhhh
  141.      Class:          WWWWiiiiddddtttthhhh
  142.      Command-Line Switch:----wwwwiiiiddddtttthhhh
  143.  
  144.           Specifies a desired width for the button.  If an image or bitmap is
  145.           being displayed in the button then the value is in screen units
  146.           (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is
  147.           in characters.  If this option isn't specified, the button's desired
  148.           width is computed from the size of the image or bitmap or text being
  149.           displayed in it.
  150.  
  151.  
  152. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  153.      The cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn command creates a new window (given by the _p_a_t_h_N_a_m_e
  154.      argument) and makes it into a checkbutton widget.  Additional options,
  155.      described above, may be specified on the command line or in the option
  156.      database to configure aspects of the checkbutton such as its colors,
  157.      font, text, and initial relief.  The cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn command returns its
  158.      _p_a_t_h_N_a_m_e argument.  At the time this command is invoked, there must not
  159.      exist a window named _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist.
  160.  
  161.      A checkbutton is a widget that displays a textual string, bitmap or image|
  162.      and a square called an _i_n_d_i_c_a_t_o_r.  If text is displayed, it must all be  |
  163.      in a single font, but it can occupy multiple lines on the screen (if it  |
  164.      contains newlines or if wrapping occurs because of the wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh option)|
  165.      and one of the characters may optionally be underlined using the         |
  166.      uuuunnnnddddeeeerrrrlllliiiinnnneeee option.  A checkbutton has all of the behavior of a simple
  167.      button, including the following: it can display itself in either of three
  168.      different ways, according to the ssssttttaaaatttteeee option; it can be made to appear
  169.      raised, sunken, or flat; it can be made to flash; and it invokes a Tcl
  170.      command whenever mouse button 1 is clicked over the checkbutton.
  171.  
  172.      In addition, checkbuttons can be _s_e_l_e_c_t_e_d.  If a checkbutton is selected |
  173.      then the indicator is normally drawn with a sunken relief and a special  |
  174.      color, and a Tcl variable associated with the checkbutton is set to a    |
  175.      particular value (normally 1).  If the checkbutton is not selected, then |
  176.      the indicator is drawn with a raised relief and no special color, and the|
  177.      associated variable is set to a different value (typically 0).  By       |
  178.      default, the name of the variable associated with a checkbutton is the   |
  179.      same as the _n_a_m_e used to create the checkbutton.  The variable name, and |
  180.      the ``on'' and ``off'' values stored in it, may be modified with options |
  181.      on the command line or in the option database.  Configuration options may|
  182.      also be used to modify the way the indicator is displayed (or whether it |
  183.      is displayed at all).  By default a checkbutton is configured to select
  184.      and deselect itself on alternate button clicks.  In addition, each
  185.      checkbutton monitors its associated variable and automatically selects
  186.      and deselects itself when the variables value changes to and from the
  187.      button's ``on'' value.
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  203.  
  204.  
  205.  
  206. WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  207.      The cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn command creates a new Tcl command whose name is _p_a_t_h_N_a_m_e.
  208.      This command may be used to invoke various operations on the widget.  It
  209.      has the following general form:
  210.  
  211.           _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  212.  
  213.      _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the command.  The
  214.      following commands are possible for checkbutton widgets:
  215.  
  216.      _p_a_t_h_N_a_m_e ccccggggeeeetttt _o_p_t_i_o_n
  217.           Returns the current value of the configuration option given by      |
  218.           _o_p_t_i_o_n.  _O_p_t_i_o_n may have any of the values accepted by the          |
  219.           cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn command.
  220.  
  221.      _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  222.           Query or modify the configuration options of the widget.  If no
  223.           _o_p_t_i_o_n is specified, returns a list describing all of the available
  224.           options for _p_a_t_h_N_a_m_e (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the
  225.           format of this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  226.           the command returns a list describing the one named option (this
  227.           list will be identical to the corresponding sublist of the value
  228.           returned if no _o_p_t_i_o_n is specified).  If one or more _o_p_t_i_o_n-_v_a_l_u_e
  229.           pairs are specified, then the command modifies the given widget
  230.           option(s) to have the given value(s);  in this case the command
  231.           returns an empty string.  _O_p_t_i_o_n may have any of the values accepted
  232.           by the cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn command.
  233.  
  234.      _p_a_t_h_N_a_m_e ddddeeeesssseeeelllleeeecccctttt
  235.           Deselects the checkbutton and sets the associated variable to its
  236.           ``off'' value.
  237.  
  238.      _p_a_t_h_N_a_m_e ffffllllaaaasssshhhh
  239.           Flashes the checkbutton.  This is accomplished by redisplaying the
  240.           checkbutton several times, alternating between active and normal
  241.           colors.  At the end of the flash the checkbutton is left in the same
  242.           normal/active state as when the command was invoked.  This command
  243.           is ignored if the checkbutton's state is ddddiiiissssaaaabbbblllleeeedddd.
  244.  
  245.      _p_a_t_h_N_a_m_e iiiinnnnvvvvooookkkkeeee
  246.           Does just what would have happened if the user invoked the
  247.           checkbutton with the mouse: toggle the selection state of the button
  248.           and invoke the Tcl command associated with the checkbutton, if there
  249.           is one.  The return value is the return value from the Tcl command,
  250.           or an empty string if there is no command associated with the
  251.           checkbutton.  This command is ignored if the checkbutton's state is
  252.           ddddiiiissssaaaabbbblllleeeedddd.
  253.  
  254.      _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt
  255.           Selects the checkbutton and sets the associated variable to its
  256.           ``on'' value.
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  269.  
  270.  
  271.  
  272.      _p_a_t_h_N_a_m_e ttttoooogggggggglllleeee
  273.           Toggles the selection state of the button, redisplaying it and
  274.           modifying its associated variable to reflect the new state.
  275.  
  276.  
  277. BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  278.      Tk automatically creates class bindings for checkbuttons that give them
  279.      the following default behavior:
  280.  
  281.      [1]  A checkbutton activates whenever the mouse passes over it and
  282.           deactivates whenever the mouse leaves the checkbutton.
  283.  
  284.      [2]  When mouse button 1 is pressed over a checkbutton it is invoked (its|
  285.           selection state toggles and the command associated with the button  |
  286.           is invoked, if there is one).
  287.  
  288.      [3]  When a checkbutton has the input focus, the space key causes the    |
  289.           checkbutton to be invoked.
  290.  
  291.      If the checkbutton's state is ddddiiiissssaaaabbbblllleeeedddd then none of the above actions
  292.      occur:  the checkbutton is completely non-responsive.
  293.  
  294.      The behavior of checkbuttons can be changed by defining new bindings for
  295.      individual widgets or by redefining the class bindings.
  296.  
  297.  
  298. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  299.      checkbutton, widget
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.